<%@ Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="CarrierManagement.aspx.vb" Inherits="GTSWeb_Carrier_Manage" title="GTS Frieght Management System"  MaintainScrollPositionOnPostback="true" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder" Runat="Server">
    <h3>Carrier Management</h3>
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" CellPadding="4"
        DataKeyNames="CarrierID" DataSourceID="CarrierGridView" ForeColor="#333333" GridLines="None" AllowPaging="True" PageSize="5" Width="100%">
        <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
        <Columns>
            <asp:CommandField ShowSelectButton="True" />
            <asp:BoundField DataField="CarrierID" HeaderText="Carrier ID" ReadOnly="True" SortExpression="CarrierID" />
            <asp:BoundField DataField="CarrierName" HeaderText="Carrier Name" SortExpression="CarrierName" />
            <asp:BoundField DataField="ContractStartDate" HeaderText="Contract Start Date" SortExpression="ContractStartDate" Visible="False" />
            <asp:BoundField DataField="ContractEndDate" HeaderText="Contract End Date" SortExpression="ContractEndDate" Visible="False" />
            <asp:TemplateField HeaderText="Contract Start Date">
                <ItemTemplate>
                    <asp:Label ID="Label4" runat="server" Text='<%# Eval("ContractStartDate", "{0:d}") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Contract End Date">
                <ItemTemplate>
                    <asp:Label ID="Label5" runat="server" Text='<%# Eval("ContractEndDate", "{0:d}") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
        <RowStyle BackColor="#F7F6F3" ForeColor="#333333" HorizontalAlign="Center" />
        <EditRowStyle BackColor="#999999" />
        <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
        <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
        <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
        <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
    </asp:GridView>

    <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False"
        CellPadding="4" DataKeyNames="CarrierID,ContactInfoID,LocationID" DataSourceID="ObjectDataSource1" ForeColor="#333333"
        GridLines="None" Height="50px" Width="100%">
        <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
        <CommandRowStyle BackColor="#E2DED6" Font-Bold="True" />
        <EditRowStyle BackColor="#999999" />
        <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
        <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
        <Fields>
            <asp:BoundField DataField="CarrierID" HeaderText="CarrierID" ReadOnly="True" SortExpression="CarrierID" Visible="False" />
            <asp:BoundField DataField="CarrierName" HeaderText="Carrier Name" SortExpression="CarrierName" />
            <asp:BoundField DataField="ContactInfoID" HeaderText="Contact Info ID" SortExpression="ContactInfoID" Visible="False" />
            <asp:TemplateField HeaderText="Status">
                <EditItemTemplate>
                    <asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="DDLStatus" DataTextField="StatusName"
                        DataValueField="StatusID" SelectedValue='<%# Bind("StatusID") %>'>
                    </asp:DropDownList><asp:ObjectDataSource ID="DDLStatus" runat="server" OldValuesParameterFormatString="{0}"
                        SelectMethod="getStatus" TypeName="GTSSystem.BLL.Status"></asp:ObjectDataSource>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="DDLStatus" DataTextField="StatusName"
                        DataValueField="StatusID" Enabled="False" SelectedValue='<%# Bind("StatusID") %>'>
                    </asp:DropDownList><asp:ObjectDataSource ID="DDLStatus" runat="server" OldValuesParameterFormatString="{0}"
                        SelectMethod="getStatus" TypeName="GTSSystem.BLL.Status"></asp:ObjectDataSource>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="ContractStartDate" HeaderText="Contract Start Date" SortExpression="ContractStartDate" Visible="False" />
            <asp:TemplateField HeaderText="Contract Start Date">
                <EditItemTemplate>
                    <asp:Calendar ID="Calendar1" runat="server" BackColor="White" BorderColor="#3366CC"
                        BorderWidth="1px" CellPadding="1" DayNameFormat="Shortest" Font-Names="Verdana"
                        Font-Size="8pt" ForeColor="#003399" Height="200px" SelectedDate='<%# Bind("ContractStartDate") %>'
                        Width="220px">
                        <SelectedDayStyle BackColor="#009999" Font-Bold="True" ForeColor="#CCFF99" />
                        <TodayDayStyle BackColor="#99CCCC" ForeColor="White" />
                        <SelectorStyle BackColor="#99CCCC" ForeColor="#336666" />
                        <WeekendDayStyle BackColor="#CCCCFF" />
                        <OtherMonthDayStyle ForeColor="#999999" />
                        <NextPrevStyle Font-Size="8pt" ForeColor="#CCCCFF" />
                        <DayHeaderStyle BackColor="#99CCCC" ForeColor="#336666" Height="1px" />
                        <TitleStyle BackColor="#003399" BorderColor="#3366CC" BorderWidth="1px" Font-Bold="True"
                            Font-Size="10pt" ForeColor="#CCCCFF" Height="25px" />
                    </asp:Calendar>
                </EditItemTemplate>
                <InsertItemTemplate>
                    <asp:Calendar ID="Calendar1" runat="server" BackColor="White" BorderColor="#3366CC"
                        BorderWidth="1px" CellPadding="1" DayNameFormat="Shortest" Font-Names="Verdana"
                        Font-Size="8pt" ForeColor="#003399" Height="200px" SelectedDate='<%# Bind("ContractStartDate") %>'
                        Width="220px">
                        <SelectedDayStyle BackColor="#009999" Font-Bold="True" ForeColor="#CCFF99" />
                        <TodayDayStyle BackColor="#99CCCC" ForeColor="White" />
                        <SelectorStyle BackColor="#99CCCC" ForeColor="#336666" />
                        <WeekendDayStyle BackColor="#CCCCFF" />
                        <OtherMonthDayStyle ForeColor="#999999" />
                        <NextPrevStyle Font-Size="8pt" ForeColor="#CCCCFF" />
                        <DayHeaderStyle BackColor="#99CCCC" ForeColor="#336666" Height="1px" />
                        <TitleStyle BackColor="#003399" BorderColor="#3366CC" BorderWidth="1px" Font-Bold="True"
                            Font-Size="10pt" ForeColor="#CCCCFF" Height="25px" />
                    </asp:Calendar>
                </InsertItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label1" runat="server" Text='<%# Eval("ContractStartDate", "{0:d}") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Contract End Date">
                <EditItemTemplate>
                    <asp:Calendar ID="Calendar2" runat="server" BackColor="White" BorderColor="#3366CC"
                        BorderWidth="1px" CellPadding="1" DayNameFormat="Shortest" Font-Names="Verdana"
                        Font-Size="8pt" ForeColor="#003399" Height="200px" SelectedDate='<%# Bind("ContractEndDate") %>'
                        Width="220px">
                        <SelectedDayStyle BackColor="#009999" Font-Bold="True" ForeColor="#CCFF99" />
                        <TodayDayStyle BackColor="#99CCCC" ForeColor="White" />
                        <SelectorStyle BackColor="#99CCCC" ForeColor="#336666" />
                        <WeekendDayStyle BackColor="#CCCCFF" />
                        <OtherMonthDayStyle ForeColor="#999999" />
                        <NextPrevStyle Font-Size="8pt" ForeColor="#CCCCFF" />
                        <DayHeaderStyle BackColor="#99CCCC" ForeColor="#336666" Height="1px" />
                        <TitleStyle BackColor="#003399" BorderColor="#3366CC" BorderWidth="1px" Font-Bold="True"
                            Font-Size="10pt" ForeColor="#CCCCFF" Height="25px" />
                    </asp:Calendar>
                </EditItemTemplate>
                <InsertItemTemplate>
                    <asp:Calendar ID="Calendar2" runat="server" BackColor="White" BorderColor="#3366CC"
                        BorderWidth="1px" CellPadding="1" DayNameFormat="Shortest" Font-Names="Verdana"
                        Font-Size="8pt" ForeColor="#003399" Height="200px" SelectedDate='<%# Bind("ContractEndDate") %>'
                        Width="220px">
                        <SelectedDayStyle BackColor="#009999" Font-Bold="True" ForeColor="#CCFF99" />
                        <TodayDayStyle BackColor="#99CCCC" ForeColor="White" />
                        <SelectorStyle BackColor="#99CCCC" ForeColor="#336666" />
                        <WeekendDayStyle BackColor="#CCCCFF" />
                        <OtherMonthDayStyle ForeColor="#999999" />
                        <NextPrevStyle Font-Size="8pt" ForeColor="#CCCCFF" />
                        <DayHeaderStyle BackColor="#99CCCC" ForeColor="#336666" Height="1px" />
                        <TitleStyle BackColor="#003399" BorderColor="#3366CC" BorderWidth="1px" Font-Bold="True"
                            Font-Size="10pt" ForeColor="#CCCCFF" Height="25px" />
                    </asp:Calendar>
                </InsertItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label2" runat="server" Text='<%# Eval("ContractEndDate", "{0:d}") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="ContractEndDate" HeaderText="Contract End Date" SortExpression="ContractEndDate" Visible="False" />
            <asp:BoundField DataField="LocationID" HeaderText="Location ID" SortExpression="LocationID" Visible="False" />
            <asp:BoundField DataField="ContactName" HeaderText="Contact Name" SortExpression="ContactName" />
            <asp:BoundField DataField="Phone" HeaderText="Phone" SortExpression="Phone" />
            <asp:BoundField DataField="Fax" HeaderText="Fax" SortExpression="Fax" />
            <asp:BoundField DataField="Email" HeaderText="Email" SortExpression="Email" />
            <asp:BoundField DataField="StreetAddress" HeaderText="Street Address" SortExpression="StreetAddress" />
            <asp:BoundField DataField="City" HeaderText="City" SortExpression="City" />
            <asp:BoundField DataField="ProvinceState" HeaderText="Province" SortExpression="ProvinceState" />
            <asp:BoundField DataField="Country" HeaderText="Country" SortExpression="Country" />
            <asp:BoundField DataField="PostalCode" HeaderText="Postal Code" SortExpression="PostalCode" />
            <asp:BoundField DataField="CarrierAccountNumber" HeaderText="Carrier Account Number"
                SortExpression="CarrierAccountNumber" />
            <asp:CommandField ShowEditButton="True" />
        </Fields>
        <FieldHeaderStyle BackColor="#E9ECF1" Font-Bold="True" Width="150px" />
        <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
        <HeaderTemplate>
            Carrier Management
        </HeaderTemplate>
        <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
    </asp:DetailsView>
    <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" OldValuesParameterFormatString="{0}"
        SelectMethod="getCarrierInfoByCarrierID" TypeName="GTSSystem.BLL.Carrier" UpdateMethod="UpdateCarrier">
        <UpdateParameters>
            <asp:Parameter Name="CarrierName" Type="String" />
            <asp:Parameter Name="ContactInfoID" Type="Int32" />
            <asp:Parameter Name="StatusID" Type="Int32" />
            <asp:Parameter Name="ContractStartDate" Type="DateTime" />
            <asp:Parameter Name="ContractEndDate" Type="DateTime" />
            <asp:Parameter Name="LocationID" Type="Int32" />
            <asp:Parameter Name="ContactName" Type="String" />
            <asp:Parameter Name="Phone" Type="String" />
            <asp:Parameter Name="Fax" Type="String" />
            <asp:Parameter Name="Email" Type="String" />
            <asp:Parameter Name="StreetAddress" Type="String" />
            <asp:Parameter Name="City" Type="String" />
            <asp:Parameter Name="ProvinceState" Type="String" />
            <asp:Parameter Name="Country" Type="String" />
            <asp:Parameter Name="PostalCode" Type="String" />
            <asp:Parameter Name="CarrierAccountNumber" Type="String" />
            <asp:ProfileParameter Name="CarrierID" PropertyName="BranchId" Type="Int32" />
        </UpdateParameters>
        <SelectParameters>
            <asp:ControlParameter ControlID="GridView1" Name="CarrierID" PropertyName="SelectedValue"
                Type="Int32" />
        </SelectParameters>
    </asp:ObjectDataSource>
    <asp:ObjectDataSource ID="CarrierGridView" runat="server" InsertMethod="AddCarrier"
        OldValuesParameterFormatString="{0}" SelectMethod="getCarrierByClientBranchId"
        TypeName="GTSSystem.BLL.Carrier" UpdateMethod="UpdateCarrier">
        <UpdateParameters>
            <asp:Parameter Name="CarrierName" Type="String" />
            <asp:Parameter Name="ContactInfoID" Type="Int32" />
            <asp:Parameter Name="StatusID" Type="Int32" />
            <asp:Parameter Name="ContractStartDate" Type="DateTime" />
            <asp:Parameter Name="ContractEndDate" Type="DateTime" />
            <asp:Parameter Name="LocationID" Type="Int32" />
            <asp:Parameter Name="ContactName" Type="String" />
            <asp:Parameter Name="Phone" Type="String" />
            <asp:Parameter Name="Fax" Type="String" />
            <asp:Parameter Name="Email" Type="String" />
            <asp:Parameter Name="StreetAddress" Type="String" />
            <asp:Parameter Name="City" Type="String" />
            <asp:Parameter Name="ProvinceState" Type="String" />
            <asp:Parameter Name="Country" Type="String" />
            <asp:Parameter Name="PostalCode" Type="String" />
            <asp:Parameter Name="CarrierAccountNumber" Type="String" />
            <asp:Parameter Name="CarrierID" Type="Int32" />
        </UpdateParameters>
        <SelectParameters>
            <asp:ProfileParameter Name="BranchID" PropertyName="BranchId" Type="Int32" />
        </SelectParameters>
        <InsertParameters>
            <asp:Parameter Name="CarrierID" Type="Int32" />
            <asp:Parameter Name="CarrierName" Type="String" />
            <asp:Parameter Name="ContactInfoID" Type="Int32" />
            <asp:Parameter Name="StatusID" Type="Int32" />
            <asp:Parameter Name="ContractStartDate" Type="DateTime" />
            <asp:Parameter Name="ContractEndDate" Type="DateTime" />
            <asp:Parameter Name="ContactName" Type="String" />
            <asp:Parameter Name="Phone" Type="String" />
            <asp:Parameter Name="Fax" Type="String" />
            <asp:Parameter Name="Email" Type="String" />
            <asp:Parameter Name="StreetAddress" Type="String" />
            <asp:Parameter Name="City" Type="String" />
            <asp:Parameter Name="ProvinceState" Type="String" />
            <asp:Parameter Name="Country" Type="String" />
            <asp:Parameter Name="PostalCode" Type="String" />
            <asp:Parameter Name="LocationID" Type="Int32" />
            <asp:Parameter Name="StatusName" Type="String" />
            <asp:Parameter Name="CarrierAccountNumber" Type="String" />
        </InsertParameters>
    </asp:ObjectDataSource>
</asp:Content>

